# Maintainer: Justin Kromlinger <hashworks@archlinux.org>
pkgname=libzim6
pkgver=6.3.2
pkgrel=3
pkgdesc="Reference implementation of the ZIM specification by the openZIM project, v6"
license=('GPL2')
arch=('loong64' 'x86_64')
depends=('xapian-core' 'zlib' 'xz' 'icu' 'zstd')
makedepends=('meson' 'gtest' 'git')
conflicts=('libzim')
url='https://github.com/openzim/libzim'
source=("libzim-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
sha256sums=('648fb5af65dd28a6b221b9294217939bf5abf929d706e7323ebb4196849a923c')

build() {
	cd "libzim-${pkgver}"
	arch-meson build
	ninja -C build
}

check() {
	cd "libzim-${pkgver}/build"
	SKIP_BIG_MEMORY_TEST=1 ninja meson-test
}

package() {
	install -Dm644 "libzim-${pkgver}/COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
	cd "libzim-${pkgver}/build"
	DESTDIR="${pkgdir}" ninja install
}
